public class AbstactDemo06 {
    public static void main(String[] args) {
        XingZhuang xingZhuang = new Circle(10);
        float area = xingZhuang.getArea();
        System.out.println(area);
    }
}


abstract class XingZhuang {
    public abstract float getArea();
}

class Circle extends XingZhuang {
    public static final float PI = 3.14f;// 常量
    private float r;

    public Circle(float r) {
        this.r = r;
    }

    @Override
    public float getArea() {
        return PI * r * r;
    }
}
